package com.annotation.factorybean;

import com.annotation.entities.Color;
import org.springframework.beans.factory.FactoryBean;

public class ColorFactoryBean implements FactoryBean<Color> {

    //该方法返回值是需要创建的bean
    @Override
    public Color getObject() throws Exception {
        System.out.println("ColorFactoryBean...getObject");
        return new Color();
    }

    //创建的bean的类型
    @Override
    public Class<?> getObjectType() {
        return Color.class;
    }

    //添加的组建是否是单例的
    @Override
    public boolean isSingleton() {
        return false;
    }
}
